<?php
class MapViewForm extends Form
{
	function MapViewForm()
	{
		Form::Form('MapViewForm');
	}
	
	function on_submit()
	{
		if(User::is_admin())
		{
			$map_content = Url::get("map_content");
			
			if(isset(CGlobal::$configs['map_content']))
			{
				DB::update('configs',array("conf_val"=>$map_content),"conf_key='map_content'");
			}
			else
			{
				DB::insert('configs',array("conf_key"=>"map_content","conf_val"=>$map_content));
			}
			
			AZLib::get_config(0,1);
			
			Url::redirect_current();
		}
	}
	
	function draw()
	{
		global $display;
			
		$map_content = @CGlobal::$configs['map_content']['conf_val'];
		
		$display->add("url_home",WEB_DIR);
		
		$display->add("is_admin",User::is_admin());
		
		$display->add("map_content",$map_content);
		
		$display->add("map_content_detail",html_entity_decode($map_content));
		
		$this->beginForm();
		$display->output("Map");
		$this->endForm();
	}
}
?>